package com.qqt.csr.common.mongo;

import org.apache.commons.lang3.StringUtils;
import org.springframework.core.convert.converter.Converter;
import org.springframework.data.convert.ReadingConverter;

@ReadingConverter
public class StringToLongConverter implements Converter<String, Long> {
    @Override
    public Long convert(String source) {
        return StringUtils.isBlank(source) ? null : Long.parseLong(source);
    }
}
